package com.own.business.system.user.controller.user.entity.form;

import com.own.component.common.exception.BusinessSimpleException;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * UpdatePasswordForm
 *
 * @author chenxueli
 * @date 2023-08-14 11:37:00
 */
@Data
public class UpdatePasswordForm implements Serializable {

    @Schema(title = "原密码")
    private String oldPassword;

    @Schema(title = "密码")
    private String password;

    @Schema(title = "加密秘钥字段key")
    private String key;

    public void check() {
        if (StringUtils.isBlank(password)) {
            throw new BusinessSimpleException("密码不能为空");
        }
    }

}
